// ignore_for_file: constant_identifier_names

import 'package:flutter/material.dart';

class MessageItem extends StatelessWidget {
  static const HORIZONTAL_PADDING = 20.0;
  static const VERTICAL_PADDING = 13.0;

  const MessageItem({
    required this.title,
    required this.lastMsg,
    this.schoolTime = 'schooltime',
    this.avatarPath = 'assets/images/background.png',
    required this.onPressed,
    this.isBadge = false,
  });

  final String title;
  final String lastMsg;
  final String schoolTime;
  final String avatarPath;
  final bool isBadge;
  final VoidCallback onPressed;

  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        ListTile(
          onTap: onPressed,
          leading: Container(
            height: 48.0,
            width: 48.0,
            child: Stack(
              children: <Widget>[
                ClipRRect(
                  borderRadius: BorderRadius.circular(6.0),
                  child: Image.asset(avatarPath),
                ),
              ],
            ),
          ),
          title: Container(
            child: Text(
              title,
              style: TextStyle(
                color: Colors.black,
                fontSize: 17.0,
              ),
              maxLines: 1,
            ),
          ),
          subtitle: Container(
            child: Text(
              lastMsg,
              style: TextStyle(color: Colors.grey, fontSize: 14.0),
              maxLines: 1,
              overflow: TextOverflow.ellipsis,
            ),
          ),
          trailing: ListView(
            children: [],
          )
          // Container(
          //   child: Text(
          //     schoolTime,
          //     style: TextStyle(color: Colors.grey, fontSize: 13.0),
          //   ),
          // ),
        ),
        Divider(height: 1, color: Colors.grey[300], indent: 80.0),
      ],
    );
  }
}
